//
//  Ext+UIDevice.swift
//  Crazy
//
//  Created by ming on 2024/10/27.
//

import UIKit

extension UIDevice {
    static var isIpad: Bool {
        let deviceType = UIDevice.current.model
        return deviceType == "iPad"
    }
    
    static var appName: String {
        return (Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String) ?? "共享画板"
    }
    
    static var appVersion: String {
        return (Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "1.0")
    }
}

extension UIScreen {
    static var size: CGSize {
        return main.bounds.size
    }
}

extension UIApplication {
    func endEditing() {
        UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
    }
}
